#pragma once
#include <Winhttp.h>
#include "Bin.h"
#include "String.h"

class Http{
public:
	Http	(PTSTR);
	~Http	(void);

	Bin*	get		(HINTERNET);
	Bin*	get		(PTSTR);
	void	put		(PTSTR,PSTR);
	uint	status	(HINTERNET);

protected:
	HINTERNET	connect;
	HINTERNET	session;

	virtual String*	hostName	(void);
	virtual int		hostPort	(void);
	virtual void	onCallback	(HINTERNET,uint,LPVOID,uint);

private:
	static void CALLBACK	callback(HINTERNET,DWORD_PTR,DWORD,LPVOID,DWORD);
};